import service from "@/utils/request"

export const getQuestionListService = params => 
    service({
        url: '/question/list',
        method: 'get',
        params
    })

export const addQuestionService = params => 
    service({
        url: '/question/add',
        method: 'post',
        data: params
    })

export const getQuestionDetailService = questionId => 
    service({
      url: '/question/detail',
      method: 'get',
      //params接收一个对象，因此即使只有一个参数也必须置于{}中
      params: { questionId }  
    })

export const editQuestionService = params => 
    service({
        url: '/question/edit',
        method: 'put',
        data: params
    })

export const deleteQuestionService = questionId => 
    service({
        url: '/question/delete',
        method: 'delete',
        params: { questionId }
    })
